define(['exports','vue'],function(exports,vue){'use strict';vue=vue&&vue.hasOwnProperty('default')?vue['default']:vue;//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var script = {
  data: function data() {
    return {
      status: '',
      showDialog: false,
      pluslist: [],
      list: [],
      count: 0,
      currentpage: 0,
      PlusID: '',
      searchkey: '',
      ManagerID: '',
      form: {
        PlusID: '',
        Username: '',
        Password: '',
        Email: '',
        Realname: '',
        Tel: '',
        Value: '',
        Value1: '',
        Value2: '',
        Value3: '',
        Value4: ''
      },
      formRules: {
        PlusID: [{
          required: true,
          message: '请选择帐号归属.',
          trigger: 'blur'
        }],
        Username: [{
          required: true,
          message: '请输入用户名.',
          trigger: 'blur'
        }, {
          min: 2,
          max: 20,
          message: '长度在2-20内.',
          trigger: 'blur'
        }],
        Realname: [{
          required: true,
          message: '请输入真实姓名.',
          trigger: 'blur'
        }, {
          min: 2,
          max: 20,
          message: '长度在2-20内.',
          trigger: 'blur'
        }],
        Password: [{
          required: true,
          message: '请输入密码.',
          trigger: 'blur'
        }, {
          min: 2,
          max: 20,
          message: '长度在2-20内.',
          trigger: 'blur'
        }],
        Email: [{
          type: 'email',
          message: '请输入正确的邮箱地址.',
          trigger: 'blur'
        }],
        Value: [{
          min: 0,
          max: 1000,
          message: '长度不能超过1000.',
          trigger: 'blur'
        }],
        Value1: [{
          min: 0,
          max: 1000,
          message: '长度不能超过1000.',
          trigger: 'blur'
        }],
        Value2: [{
          min: 0,
          max: 1000,
          message: '长度不能超过1000.',
          trigger: 'blur'
        }],
        Value3: [{
          min: 0,
          max: 1000,
          message: '长度不能超过1000.',
          trigger: 'blur'
        }],
        Value4: [{
          min: 0,
          max: 1000,
          message: '长度不能超过1000.',
          trigger: 'blur'
        }]
      }
    };
  },
  mounted: function mounted() {
    App.Page.init(this);
    this.loadplus();
    this.$refs.nav.$children[0].handleClick();
  },
  methods: {
    open: function open(index) {
      this.status = index;
      this.PlusID = '';
      this.searchkey = '';
      this.load();
    },
    loadplus: function loadplus() {
      var _this = this;

      App.Service.post("/plus/NewI/SysManager/GetPlus", {}).then(function (res) {
        if (res.success) {
          _this.pluslist = res.data;
        }
      });
    },
    load: function load(PlusID, searchkey) {
      var _this2 = this;

      App.Service.post("/plus/NewI/SysManager/GetManagers", {
        PlusID: PlusID,
        key: searchkey,
        status: this.status,
        start: App.Fn.toStart(this.currentpage),
        limit: App.pagesize
      }).then(function (res) {
        if (res.success) {
          _this2.list = res.data;
          _this2.count = res.totalcount;
        }
      });
    },
    openDialog: function openDialog(ManagerID) {
      var _this3 = this;

      this.ManagerID = ManagerID;

      if (!ManagerID) {
        this.showDialog = true;
        return;
      }

      App.Service.post("/plus/NewI/SysManager/GetManager", {
        ManagerID: ManagerID
      }).then(function (res) {
        if (res.success) {
          _this3.showDialog = true;
          _this3.form = res.data;
        }
      });
    },
    closeDialog: function closeDialog() {
      this.showDialog = false;
      this.resetForm();
    },
    search: function search() {
      this.load(this.PlusID, this.searchkey);
    },
    submit: function submit() {
      var _this4 = this;

      this.$refs["form"].validate(function (valid) {
        if (valid) {
          if (_this4.ManagerID) {
            App.Service.post("/plus/NewI/SysManager/EditManager", App.Fn.clone(_this4.form, {
              ManagerID: _this4.ManagerID
            })).then(function (res) {
              if (res.success) {
                App.Msg.success('管理员编辑成功！');

                _this4.resetForm();

                _this4.showDialog = false;

                _this4.load();
              }
            });
            return;
          }

          App.Service.post("/plus/NewI/SysManager/AddManager", _this4.form).then(function (res) {
            if (res.success) {
              App.Msg.success('管理员创建成功！');

              _this4.resetForm();

              _this4.showDialog = false;

              _this4.load();
            }
          });
        }
      });
    },
    resetForm: function resetForm() {
      this.$refs["form"].resetFields();
    },
    pagerclick: function pagerclick(currentpage) {
      this.currentpage = currentpage;
      this.load();
    },
    pass: function pass(ManagerID) {
      var _this5 = this;

      App.Service.post("/plus/NewI/SysManager/PassManager", {
        ManagerID: ManagerID
      }).then(function (res) {
        if (res.success) {
          App.Msg.success('帐号已开通.');

          _this5.load();
        }
      });
    },
    stop: function stop(ManagerID) {
      var _this6 = this;

      App.Service.post("/plus/NewI/SysManager/StopManager", {
        ManagerID: ManagerID
      }).then(function (res) {
        if (res.success) {
          App.Msg.success('帐号已停用.');

          _this6.load();
        }
      });
    },
    reset: function reset(ManagerID) {
      var _this7 = this;

      App.Page.confirm("确认要重置密码吗? 重置后密码跟用户名一样.", function () {
        App.Service.post("/plus/NewI/SysManager/ResetManager", {
          ManagerID: ManagerID
        }).then(function (res) {
          if (res.success) {
            App.Msg.success('密码重置成功.');

            _this7.load();
          }
        });
      });
    },
    del: function del(ManagerID) {
      var _this8 = this;

      App.Page.confirm("确认删除该管理员帐号吗?", function () {
        App.Service.post("/plus/NewI/SysManager/DeleteManager", {
          ManagerID: ManagerID
        }).then(function (res) {
          if (res.success) {
            App.Msg.success('帐号删除成功.');

            _this8.load();
          }
        });
      });
    }
  }
};function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
    if (typeof shadowMode !== 'boolean') {
        createInjectorSSR = createInjector;
        createInjector = shadowMode;
        shadowMode = false;
    }
    // Vue.extend constructor export interop.
    const options = typeof script === 'function' ? script.options : script;
    // render functions
    if (template && template.render) {
        options.render = template.render;
        options.staticRenderFns = template.staticRenderFns;
        options._compiled = true;
        // functional template
        if (isFunctionalTemplate) {
            options.functional = true;
        }
    }
    // scopedId
    if (scopeId) {
        options._scopeId = scopeId;
    }
    let hook;
    if (moduleIdentifier) {
        // server build
        hook = function (context) {
            // 2.3 injection
            context =
                context || // cached call
                    (this.$vnode && this.$vnode.ssrContext) || // stateful
                    (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
            // 2.2 with runInNewContext: true
            if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
                context = __VUE_SSR_CONTEXT__;
            }
            // inject component styles
            if (style) {
                style.call(this, createInjectorSSR(context));
            }
            // register component module identifier for async chunk inference
            if (context && context._registeredComponents) {
                context._registeredComponents.add(moduleIdentifier);
            }
        };
        // used by ssr in case component is cached and beforeCreate
        // never gets called
        options._ssrRegister = hook;
    }
    else if (style) {
        hook = shadowMode
            ? function (context) {
                style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
            }
            : function (context) {
                style.call(this, createInjector(context));
            };
    }
    if (hook) {
        if (options.functional) {
            // register for functional component in vue file
            const originalRender = options.render;
            options.render = function renderWithStyleInjection(h, context) {
                hook.call(context);
                return originalRender(h, context);
            };
        }
        else {
            // inject component registration as beforeCreate hook
            const existing = options.beforeCreate;
            options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
        }
    }
    return script;
}/* script */
var __vue_script__ = script;
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c("div", {
    staticClass: "ad-content"
  }, [_c("div", {
    staticClass: "ad-tree"
  }, [_vm._m(0), _vm._v(" "), _c("div", {
    staticClass: "ad-treebody"
  }, [_c("el-menu", {
    ref: "nav",
    attrs: {
      "background-color": "#E8E8EB"
    },
    on: {
      select: _vm.open
    }
  }, [_c("el-menu-item", {
    attrs: {
      index: "1"
    }
  }, [_c("i", {
    staticClass: "icon-pause el-icon--left"
  }), _vm._v(" "), _c("span", {
    attrs: {
      slot: "title"
    },
    slot: "title"
  }, [_vm._v("待开通")])]), _vm._v(" "), _c("el-menu-item", {
    attrs: {
      index: "2"
    }
  }, [_c("i", {
    staticClass: "icon-play2 el-icon--left"
  }), _vm._v(" "), _c("span", {
    attrs: {
      slot: "title"
    },
    slot: "title"
  }, [_vm._v("已开通")])]), _vm._v(" "), _c("el-menu-item", {
    attrs: {
      index: "3"
    }
  }, [_c("i", {
    staticClass: "icon-stop el-icon--left"
  }), _vm._v(" "), _c("span", {
    attrs: {
      slot: "title"
    },
    slot: "title"
  }, [_vm._v("已停用")])])], 1)], 1)]), _vm._v(" "), _c("div", {
    staticClass: "ad-main"
  }, [_vm._m(1), _vm._v(" "), _c("div", {
    staticClass: "ad-console-body"
  }, [_c("div", {
    staticClass: "ad-console-toolbar"
  }, [_c("el-button", {
    attrs: {
      type: "primary",
      size: "mini",
      icon: "icon-plus4 el-icon--left"
    },
    on: {
      click: function click($event) {
        return _vm.openDialog();
      }
    }
  }, [_vm._v("创建管理员")]), _vm._v(" "), _c("div", {
    staticStyle: {
      float: "right"
    }
  }, [_c("el-select", {
    staticStyle: {
      width: "150px"
    },
    attrs: {
      placeholder: "请选择",
      size: "small"
    },
    model: {
      value: _vm.PlusID,
      callback: function callback($$v) {
        _vm.PlusID = $$v;
      },
      expression: "PlusID"
    }
  }, _vm._l(_vm.pluslist, function (item) {
    return _c("el-option", {
      key: item.PlusID,
      attrs: {
        label: item.PlusName,
        value: item.PlusID
      }
    });
  }), 1), _vm._v(" "), _c("el-input", {
    staticStyle: {
      width: "180px"
    },
    attrs: {
      placeholder: "请输入关键字",
      size: "small"
    },
    model: {
      value: _vm.searchkey,
      callback: function callback($$v) {
        _vm.searchkey = $$v;
      },
      expression: "searchkey"
    }
  }), _vm._v(" "), _c("el-button", {
    attrs: {
      type: "primary",
      size: "mini",
      icon: "icon-search"
    },
    on: {
      click: function click($event) {
        return _vm.search();
      }
    }
  })], 1)], 1), _vm._v(" "), _c("div", {
    staticClass: "ad-card"
  }, [_c("el-table", {
    staticStyle: {
      width: "100%"
    },
    attrs: {
      data: _vm.list,
      size: "mini",
      border: ""
    }
  }, [_c("el-table-column", {
    attrs: {
      prop: "ManagerID",
      label: "编号",
      width: "100",
      align: "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      prop: "Username",
      label: "用户名",
      width: "130",
      align: "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      prop: "Realname",
      label: "真实姓名",
      width: "130",
      align: "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      prop: "Tel",
      label: "电话",
      width: "130",
      align: "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      prop: "Value",
      label: "备注",
      "header-align": "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      prop: "Plus.PlusName",
      label: "帐号归属",
      width: "130",
      align: "center"
    }
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      label: "权限",
      width: "50",
      align: "center",
      fixed: "right"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(scope) {
        return [_c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.openDialog(scope.row.ManagerID);
            }
          }
        }, [_vm._v("权限")])];
      }
    }])
  }), _vm._v(" "), _c("el-table-column", {
    attrs: {
      label: "操作",
      width: "160",
      align: "center",
      fixed: "right"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(scope) {
        return [_c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.openDialog(scope.row.ManagerID);
            }
          }
        }, [_vm._v("编辑")]), _vm._v(" "), scope.row.Status == "1" || scope.row.Status == "3" ? _c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.pass(scope.row.ManagerID);
            }
          }
        }, [_vm._v("开通")]) : _vm._e(), _vm._v(" "), scope.row.Status == "2" ? _c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.stop(scope.row.ManagerID);
            }
          }
        }, [_vm._v("停用")]) : _vm._e(), _vm._v(" "), scope.row.Status == "2" ? _c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.reset(scope.row.ManagerID);
            }
          }
        }, [_vm._v("重置密码")]) : _vm._e(), _vm._v(" "), scope.row.Status == "1" ? _c("el-button", {
          attrs: {
            type: "text",
            size: "mini"
          },
          on: {
            click: function click($event) {
              return _vm.del(scope.row.ManagerID);
            }
          }
        }, [_vm._v("删除")]) : _vm._e()];
      }
    }])
  })], 1)], 1)]), _vm._v(" "), _c("el-dialog", {
    attrs: {
      title: "创建管理员",
      visible: _vm.showDialog,
      width: "650px"
    },
    on: {
      close: function close($event) {
        _vm.showDialog = false;

        _vm.resetForm();
      }
    }
  }, [_c("el-form", {
    ref: "form",
    attrs: {
      model: _vm.form,
      rules: _vm.formRules,
      "label-width": "85px"
    }
  }, [_c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [!_vm.ManagerID ? [_c("el-col", {
    attrs: {
      span: 12
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "用户名",
      prop: "Username"
    }
  }, [_c("el-input", {
    model: {
      value: _vm.form.Username,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Username", $$v);
      },
      expression: "form.Username"
    }
  })], 1)], 1), _vm._v(" "), _c("el-col", {
    attrs: {
      span: 11
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "密码",
      prop: "Password"
    }
  }, [_c("el-input", {
    attrs: {
      type: "password"
    },
    model: {
      value: _vm.form.Password,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Password", $$v);
      },
      expression: "form.Password"
    }
  })], 1)], 1)] : [_c("el-col", {
    attrs: {
      span: 23
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "用户名",
      prop: "Username"
    }
  }, [_c("el-input", {
    model: {
      value: _vm.form.Username,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Username", $$v);
      },
      expression: "form.Username"
    }
  })], 1)], 1)]], 2), _vm._v(" "), _c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [_c("el-col", {
    attrs: {
      span: 12
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "真实姓名",
      prop: "Realname"
    }
  }, [_c("el-input", {
    model: {
      value: _vm.form.Realname,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Realname", $$v);
      },
      expression: "form.Realname"
    }
  })], 1)], 1), _vm._v(" "), _c("el-col", {
    attrs: {
      span: 11
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "电话",
      prop: "Tel"
    }
  }, [_c("el-input", {
    model: {
      value: _vm.form.Tel,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Tel", $$v);
      },
      expression: "form.Tel"
    }
  })], 1)], 1)], 1), _vm._v(" "), _c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [_c("el-col", {
    attrs: {
      span: 12
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "电子邮箱",
      prop: "Email"
    }
  }, [_c("el-input", {
    model: {
      value: _vm.form.Email,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Email", $$v);
      },
      expression: "form.Email"
    }
  })], 1)], 1), _vm._v(" "), _c("el-col", {
    attrs: {
      span: 11
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "帐号归属",
      prop: "PlusID"
    }
  }, [_c("el-select", {
    staticStyle: {
      width: "100%"
    },
    attrs: {
      placeholder: "请选择"
    },
    model: {
      value: _vm.form.PlusID,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "PlusID", $$v);
      },
      expression: "form.PlusID"
    }
  }, _vm._l(_vm.pluslist, function (item) {
    return _c("el-option", {
      key: item.PlusID,
      attrs: {
        label: item.PlusName,
        value: item.PlusID
      }
    });
  }), 1)], 1)], 1)], 1), _vm._v(" "), _c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [_c("el-col", {
    attrs: {
      span: 23
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "备注",
      prop: "Value"
    }
  }, [_c("el-input", {
    attrs: {
      type: "textarea"
    },
    model: {
      value: _vm.form.Value,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Value", $$v);
      },
      expression: "form.Value"
    }
  })], 1)], 1)], 1), _vm._v(" "), _c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [_c("el-col", {
    attrs: {
      span: 12
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "备注1",
      prop: "Value1"
    }
  }, [_c("el-input", {
    attrs: {
      type: "textarea"
    },
    model: {
      value: _vm.form.Value1,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Value1", $$v);
      },
      expression: "form.Value1"
    }
  })], 1)], 1), _vm._v(" "), _c("el-col", {
    attrs: {
      span: 11
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "备注2",
      prop: "Value2"
    }
  }, [_c("el-input", {
    attrs: {
      type: "textarea"
    },
    model: {
      value: _vm.form.Value2,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Value2", $$v);
      },
      expression: "form.Value2"
    }
  })], 1)], 1)], 1), _vm._v(" "), _c("el-form-item", {
    attrs: {
      "label-width": "0px"
    }
  }, [_c("el-col", {
    attrs: {
      span: 12
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "备注3",
      prop: "Value3"
    }
  }, [_c("el-input", {
    attrs: {
      type: "textarea"
    },
    model: {
      value: _vm.form.Value3,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Value3", $$v);
      },
      expression: "form.Value3"
    }
  })], 1)], 1), _vm._v(" "), _c("el-col", {
    attrs: {
      span: 11
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "备注4",
      prop: "Value4"
    }
  }, [_c("el-input", {
    attrs: {
      type: "textarea"
    },
    model: {
      value: _vm.form.Value4,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "Value4", $$v);
      },
      expression: "form.Value4"
    }
  })], 1)], 1)], 1), _vm._v(" "), _c("el-form-item", [_c("el-button", {
    attrs: {
      type: "primary",
      size: "medium"
    },
    on: {
      click: _vm.submit
    }
  }, [_vm._v("提交")]), _vm._v(" "), _c("el-button", {
    attrs: {
      size: "medium"
    },
    on: {
      click: _vm.resetForm
    }
  }, [_vm._v("重置")])], 1)], 1)], 1)], 1)]);
};

var __vue_staticRenderFns__ = [function () {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c("div", {
    staticClass: "ad-title"
  }, [_c("span", [_vm._v("管理员管理")])]);
}, function () {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c("div", {
    staticClass: "ad-console-top"
  }, [_c("div", {
    staticClass: "ad-console-top-name"
  }, [_vm._v("管理员列表")]), _vm._v(" "), _c("div", {
    staticClass: "ad-console-top-body"
  }), _vm._v(" "), _c("div", {
    staticClass: "ad-console-top-end"
  })]);
}];
__vue_render__._withStripped = true;
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = undefined;
/* module identifier */

var __vue_module_identifier__ = undefined;
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

/* style inject shadow dom */

var __vue_component__ = normalizeComponent({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);//Vue.component("newi-errordetail", ErrorDetail);

var router = [{
  path: '/newi/manager/sysmanager!:query',
  name: 'newi_sysmanager',
  component: __vue_component__
}];exports.router=router;Object.defineProperty(exports,'__esModule',{value:true});});